import threading
import logging

import testone
import testtwo





'''
one的启动线程类
'''
class one_thread(threading.Thread):
    def __init__(self, threadID, name):
        threading.Thread.__init__(self)
        self.threadID = threadID
        self.name = name

    def run(self):
        logging.debug("[main.py] one开启线程：" + self.name)
        print ("[main.py] one开启线程：" + self.name)

        testone.onefunction()

        logging.debug("[main.py] one开启线程：" + self.name)
        print ("[main.py] one开启线程：" + self.name)


'''
two的启动线程类
'''
class two_thread(threading.Thread):
    def __init__(self, threadID, name):
        threading.Thread.__init__(self)
        self.threadID = threadID
        self.name = name

    def run(self):
        logging.debug("[main.py] two开启线程：" + self.name)
        print ("[main.py] two开启线程：" + self.name)

        testtwo.twofunction()

        logging.debug("[main.py] two开启线程：" + self.name)
        print ("[main.py] two开启线程：" + self.name)


if __name__ == '__main__':
        oneThread = one_thread(1, 'one_thread')
        oneThread.start()

        twoThread = two_thread(1, 'one_thread')
        twoThread.start()

        


